package com.coocaa.ops.admin.v1.audit.provider.impl;


import com.coocaa.ops.admin.v1.audit.model.CheckInfoModel;
import com.coocaa.ops.admin.v1.audit.model.ExecutionTaskModel;
import com.coocaa.ops.admin.v1.audit.provider.IAuditTaskProvider;
import com.coocaa.ops.admin.v1.layout.biz.impl.LayoutInfoBizImpl;
import com.coocaa.ops.common.core.base.model.ResourceBaseModel;
import com.coocaa.ops.common.core.biz.layout.entity.LayoutInfoEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author bijiahao
 * @date : 2018/11/13.
 * @description:
 * 审核前校验-审核-撤销审核-上架操作 提供者接口实现-布局
 *
 */
@Service
public class LayoutAuditTaskProviderImpl implements IAuditTaskProvider {
    @Autowired
    private LayoutInfoBizImpl layoutBiz;

    @Override
    public void auditTask(ExecutionTaskModel executionTaskModel, Integer userId) {
        LayoutInfoEntity update = new LayoutInfoEntity();
        update.setId(executionTaskModel.getId());
        update.setModifier(userId);
        update.setStatus(executionTaskModel.getAuditFlag());
        layoutBiz.updateById(update);
    }

    @Override
    public void putShelves(ResourceBaseModel resourceBaseModel, Integer userId) {

    }

    @Override
    public void revokedAudit(ResourceBaseModel resourceBaseModel, Integer userId) {

    }

    @Override
    public CheckInfoModel checkBeforeAudit(ResourceBaseModel resourceBaseModel) {
        return CheckInfoModel.getCheckInfoModel(Boolean.FALSE, null);
    }

    @Override
    public void cancelTask(ResourceBaseModel resourceBaseModel, Integer userId) {

    }
}
